def reverse_str_list(s_list, l, r):
    while l < r:
        s_list[l], s_list[r] = s_list[r], s_list[l]
        l += 1
        r -= 1

# 转成字符数组
k = int(input())
s = input()
s_list = list(s)
# 将前后两个子串进行反转
reverse_str_list(s_list, 0, len(s_list) - k - 1)
reverse_str_list(s_list, len(s_list) - k, len(s_list) - 1)
# 将整个串进行翻转
reverse_str_list(s_list, 0, len(s_list) - 1)
print("".join(s_list))